Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename SpineMaterial to SpineMaterial2d and add SpineMaterial3d #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mattincho
Copy link

This PR (Continuing work from: #30 ) renames SpineMaterial to SpineMaterial2d and introduces a new SpineMaterial3d that allows the use of StandardMaterial to render Spine animations in 3D.

While using StandardMaterial works for 3D visualization, the result appears quite dark by default. To address this, the example uses the unlit flag. However, this is a temporary workaround, and it may be beneficial for someone to create a shader-based solution to correct the dark appearance in the future.

Feel free to test and share your feedback!

162352

@jabuwu
Copy link
Owner

jabuwu commented Jan 7, 2025

Much appreciated. The reason for the Bevy 0.15 delays has mostly been due to me procrastinating on this work. I'll get around to reviewing it as soon as I can!

@Mattincho
Copy link
Author

Mattincho commented Jan 7, 2025

Locally, I tried to do a MaterialExtension from StandardMaterial, but out.color = apply_pbr_lighting(pbr_input); doesn't really work (this is what gives us the really dark output, independent of the light direction/color/intensity). Maybe someone more knowledgeable about these shader dark arts can take a look at the bevy_pbr code.

@jabuwu
Copy link
Owner

jabuwu commented Jan 13, 2025

I'm not too worried about how 3D looks. Even when I first implemented it, it's not correct. Spine isn't meant to work in a PBR environment. It's possible with enough voodoo and I didn't want this library to be the limiting factor, but it's not a priority.

There's a few things that need to get sorted out in 2D examples. The custom_material example should not have all these black boxes:

Screenshot 2025-01-12 at 7 49 29 PM

And even the simple example seems to have some alpha problems:

Screenshot 2025-01-12 at 7 40 09 PM

How it should look:

Screenshot 2025-01-12 at 7 42 12 PM

It's probably something simple, just gotta track it down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants